/**
 * author: 何其沆(pooky)
 * desc: Pool - api
 * date: 2021-11-16
 */
import { get, post } from '@/utils/request.js'
import api from '@/config/index.js'

export default {
  /**
   * searchCheck
   * @param mailBox
   * @returns {Promise | Promise<unknown>}
   */
  searchCheck(mailBox) {
    return get(api.API_VERSION + '/Pool/SearchCheck', { mailBox }, false)
  },
  /**
   * 管理端searchCheck
   * @param mailBox
   * @returns {Promise | Promise<unknown>}
   */
  adminSearchCheck(mailBox) {
    return get(api.API_VERSION + '/Admin/Pool/SearchCheck', { mailBox }, false)
  },
  /**
   * inputCheck
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  inputCheck(data) {
    return post(api.API_VERSION + '/Pool/InputCheck', data, false)
  },
  /**
   * 管理端inputCheck
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  adminInputCheck(data) {
    return post(api.API_VERSION + '/Admin/Pool/InputCheck', data, false)
  },
  /**
   * fileCheck
   * @param data
   * @returns {Promise<unknown>}
   */
  fileCheck(data) {
    return post(api.API_VERSION + '/Pool/FileCheck', data, ['fileForm', 'blobResponse'])
  },
  /**
   * 管理端fileCheck
   * @param data
   * @returns {Promise<unknown>}
   */
  adminFileCheck(data) {
    return post(api.API_VERSION + '/Admin/Pool/FileCheck', data, ['fileForm', 'blobResponse'])
  },
  /**
   * 创建永不联系
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  createNeverContact(data) {
    return post(api.API_VERSION + '/Pool/CreateNeverContactClient', data, false)
  },
  /**
   * 管理端创建永不联系
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  createAdminNeverContact(data) {
    return post(api.API_VERSION + '/Admin/Pool/CreateNeverContactClient', data, false)
  },
  /**
   * 下载模板
   * @returns {Promise | Promise<unknown>}
   */
  downloadTemplate() {
    return post(api.API_VERSION + '/Admin/Pool/DownloadTemplate', {}, ['fileForm', 'blobResponse'], false)
  },
  /**
   * 上传文件
   * @param data
   * @returns {Promise<unknown>}
   */
  importClientPool(data) {
    return post(api.API_VERSION + '/Admin/Pool/ImportClientPool', data, ['fileForm', 'blobResponse'], false)
  }
}
